package com.itheima.web.controller;

import com.itheima.web.MyInterface.Aop;
import com.itheima.web.domain.WeixinUser;
import com.itheima.web.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController(value = "/user" )
public class UserController {

    @Autowired
    UserService userService;

    @GetMapping
    @Aop(value = "获取用户信息",name ="aop")
    public WeixinUser getUser(@RequestParam(value = "id",defaultValue = "1") String id){
       WeixinUser user = userService.findById(id);
        System.out.println("master1");
        return  user;
    }
}
